import sqlparse

def get_table2(sql_statement):
    parsed = sqlparse.parse(sql_statement)
    for stmt in parsed:
        for token in stmt.tokens:
            if isinstance(token, sqlparse.sql.IdentifierList):
                for identifier in token.get_identifiers():
                    print(identifier.get_real_name())
            elif isinstance(token, sqlparse.sql.Identifier):
                print(token.get_real_name())

if __name__ == '__main__':
    sql = "select * from tb1 where c1='a';"
    get_table1(sql)
    sql = "select * from tb1 a , tb2 b  where  a.id=b.id  and   c1='a';"
    get_table1(sql)
    sql ="UPDATE  tb3  SET b = 1 WHERE c1='47d8af9d8cd1459a927327b9d548a37b' "
    get_table1(sql)